import 'package:ati_package/core/extension/ati_widgets_extension.dart';
import 'package:ati_package/core/routes/app_routes.dart';
import 'package:ati_package/core/utils/ati_assets.dart';
import 'package:ati_package/pages/common/ati_scaffold.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

import 'widgets/user_f_widget.dart';
import 'widgets/user_h_widget.dart';
import 'widgets/user_m_widget.dart';

class PersonalCenterView extends StatefulWidget {
  const PersonalCenterView({super.key});

  @override
  State<PersonalCenterView> createState() => _PersonalCenterViewState();
}

class _PersonalCenterViewState extends State<PersonalCenterView> {
  @override
  Widget build(BuildContext context) {
    return AtiScaffold(
      title: '我的',
      showBack: false,
      extendBodyBehindAppBar: true,
      barBgColor: Colors.transparent,
      actionWidget: _buildActionWidget(),
      body: SingleChildScrollView(
        child: Column(children: [UserHWidget(), UserMWidget(), UserFWidget()]),
      ),
    );
  }

  _buildActionWidget() {
    return Row(
      children: [
        Image.asset(
          width: 22.5.r,
          height: 22.5.r,
          AtiAssets.userHNotice,
          package: 'ati_package',
        ).addTapGesture(
          onTap: () {
            Get.toNamed(AtiAppRoutes.notice);
          },
        ),
        SizedBox(width: 15.r),
        Image.asset(
          width: 22.5.r,
          height: 22.5.r,
          AtiAssets.userHSet,
          package: 'ati_package',
        ).addTapGesture(
          onTap: () {
            Get.toNamed(AtiAppRoutes.userSetting);
          },
        ),
      ],
    );
  }
}
